<?php

/**
 * Description of Category
 *
 * @author Admin
 */
class Category_Form_Subcategory_Subcategoryform extends WOW_Form_Abstract
{

     public $elementDecorators = array(
            'ViewHelper',
            array(array('data' => 'HtmlTag'), array('tag' => 'span' )),
            array('Label', array('tag' => 'div', 'class'  => 'flt col250')
            )
    );

    public function init()
    {
        $this->setMethod('post');
        $this->setAction('');
        $cat_model = new Category_Model_Category();
        $cats = $cat_model->getAllCategoryArray();
        

        // adding elements
        $this->addElement('text', 'SubCategoryName', array(
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('StringLength', true, array(4, 128))
            ),
            'required'  => true,
            'label'     => 'Sub-Category Name',
            'class'     => 'input-medium',
            'decorators'=> $this->elementDecorators
        ));

         $this->addElement('select', 'catid', array(
            'filters'    => array('StringTrim'),
            'required'  => true,
            'label'     => 'Select Category',
            'multiOptions' => $cats,
            'decorators'=> $this->elementDecorators
        ));

         $this->addElement('submit', 'submit', array(
            'required' => false,
            'ignore'   => true,
            'value'    => 'Save'
        ));

         $this->addElement('hidden', 'subcatid', array(
            'filters'    => array('StringTrim'),
            'decorators'=> $this->elementDecorators
        ));

        
    }
}
?>
